package com.tanjie.blackbean.pojo.exception;

import cn.hutool.core.text.StrFormatter;
import com.tanjie.blackbean.pojo.response.AuthErrorCode;
import com.tanjie.blackbean.pojo.response.BizErrorCode;
import com.tanjie.blackbean.pojo.response.IResult;
import lombok.Getter;
import lombok.Setter;

/**
 * @author: tanjie
 * @date: 2022-04-07
 **/
public class AuthException extends RuntimeException {

    @Getter
    @Setter
    IResult bizErrorCode;

    public AuthException() {
        bizErrorCode = AuthErrorCode.DEFAULT;
    }

    public AuthException(String message) {
        super(message);
        bizErrorCode = BizErrorCode.DEFAULT;
    }

    public AuthException(IResult errorResult) {
        super();
        this.bizErrorCode = errorResult;
    }

    public AuthException(String message, Object... arguments) {
        super(StrFormatter.format(message, arguments));
        bizErrorCode = BizErrorCode.DEFAULT;
    }

}
